package com.zxq.web.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 指令解析格式
 * @TableName iot_cmd_decode
 */
@TableName(value ="iot_cmd_decode")
@Data
public class IotCmdDecodeDo implements Serializable {
    /**
     * 主键
     */
    @TableId
    private Long id;

    /**
     * 备注
     */
    private String remark;

    /**
     * 序列号
     */
    private Integer sequence;

    /**
     * 字段类型
     */
    private Long fieldType;

    /**
     * 截获类型
     */
    private Long trimType;

    /**
     * 截获参数
     */
    private Integer trimParam;

    /**
     * 大小端
     */
    private String bigLittleEndian;

    /**
     * 字段
     */
    private String field;

    /**
     * 与协议指令关联
     */
    private Long cmdId;

    /**
     * 创建者
     */
    private Long creator;

    /**
     * 创建时间
     */
    private Date createDate;

    /**
     * 更新者
     */
    private Long updater;

    /**
     * 更新时间
     */
    private Date updateDate;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        IotCmdDecodeDo other = (IotCmdDecodeDo) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()))
            && (this.getSequence() == null ? other.getSequence() == null : this.getSequence().equals(other.getSequence()))
            && (this.getFieldType() == null ? other.getFieldType() == null : this.getFieldType().equals(other.getFieldType()))
            && (this.getTrimType() == null ? other.getTrimType() == null : this.getTrimType().equals(other.getTrimType()))
            && (this.getTrimParam() == null ? other.getTrimParam() == null : this.getTrimParam().equals(other.getTrimParam()))
            && (this.getBigLittleEndian() == null ? other.getBigLittleEndian() == null : this.getBigLittleEndian().equals(other.getBigLittleEndian()))
            && (this.getField() == null ? other.getField() == null : this.getField().equals(other.getField()))
            && (this.getCmdId() == null ? other.getCmdId() == null : this.getCmdId().equals(other.getCmdId()))
            && (this.getCreator() == null ? other.getCreator() == null : this.getCreator().equals(other.getCreator()))
            && (this.getCreateDate() == null ? other.getCreateDate() == null : this.getCreateDate().equals(other.getCreateDate()))
            && (this.getUpdater() == null ? other.getUpdater() == null : this.getUpdater().equals(other.getUpdater()))
            && (this.getUpdateDate() == null ? other.getUpdateDate() == null : this.getUpdateDate().equals(other.getUpdateDate()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
        result = prime * result + ((getSequence() == null) ? 0 : getSequence().hashCode());
        result = prime * result + ((getFieldType() == null) ? 0 : getFieldType().hashCode());
        result = prime * result + ((getTrimType() == null) ? 0 : getTrimType().hashCode());
        result = prime * result + ((getTrimParam() == null) ? 0 : getTrimParam().hashCode());
        result = prime * result + ((getBigLittleEndian() == null) ? 0 : getBigLittleEndian().hashCode());
        result = prime * result + ((getField() == null) ? 0 : getField().hashCode());
        result = prime * result + ((getCmdId() == null) ? 0 : getCmdId().hashCode());
        result = prime * result + ((getCreator() == null) ? 0 : getCreator().hashCode());
        result = prime * result + ((getCreateDate() == null) ? 0 : getCreateDate().hashCode());
        result = prime * result + ((getUpdater() == null) ? 0 : getUpdater().hashCode());
        result = prime * result + ((getUpdateDate() == null) ? 0 : getUpdateDate().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", remark=").append(remark);
        sb.append(", sequence=").append(sequence);
        sb.append(", fieldType=").append(fieldType);
        sb.append(", trimType=").append(trimType);
        sb.append(", trimParam=").append(trimParam);
        sb.append(", bigLittleEndian=").append(bigLittleEndian);
        sb.append(", field=").append(field);
        sb.append(", cmdId=").append(cmdId);
        sb.append(", creator=").append(creator);
        sb.append(", createDate=").append(createDate);
        sb.append(", updater=").append(updater);
        sb.append(", updateDate=").append(updateDate);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}